package com.wangxiang.shop.order.controller;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


import com.wangxiang.common.utils.PageEntity;
import com.wangxiang.shop.order.feign.MemberFeign;
import com.wangxiang.shop.order.feign.ProductFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.wangxiang.shop.order.entity.ReceiptOrderEntity;
import com.wangxiang.shop.order.service.ReceiptOrderService;
import com.wangxiang.common.utils.PageUtils;
import com.wangxiang.common.utils.R;



/**
 * 
 *
 * @author wangxiang
 * @email 2293672863@qq.com
 * @date 2022-04-23 16:57:39
 */
@RestController
@RequestMapping("order/receiptorder")
public class ReceiptOrderController {
    @Autowired
    private ReceiptOrderService receiptOrderService;
    @Autowired
    MemberFeign memberFeign;
    @Autowired
    ProductFeign productFeign;

    @RequestMapping("page")
    public R page(@RequestBody HashMap<String , Integer> map){
        PageEntity page = receiptOrderService.page(map);
        List<HashMap<String, Object>> list = receiptOrderService.pageList((List<ReceiptOrderEntity>) page.getList());
        List<HashMap<String, Object>> listMap = productFeign.memberOrderList(list);
        List<HashMap<String, Object>> list1 = memberFeign.memberOrderList(listMap);
        return R.ok().put("page" , page).put("list",list1);

    }


}
